package com.element.security.single.service;

import org.springframework.util.CollectionUtils;

import java.util.HashSet;
import java.util.Set;

public interface IGrantTypeService {

    String PASSWORD = "password";

    Set<String> grantType();

    default Set<String> getGrantTypes() {
        Set<String> grantTypes = grantType();
        if (CollectionUtils.isEmpty(grantTypes)) {
            grantTypes = new HashSet<>();
        }
        grantTypes.add(PASSWORD);
        return grantTypes;
    }
}